import { defineStore } from "pinia";
import { removeToken } from '@/utils/cookies'
import { resetRouter } from '@/router'

export const useAuthStore = defineStore("auth", {
  state: (): { 
    token: string
  } => { 
    return {
      token: ''
    }
         
  },
  getters: {

  },
  actions: {
    SET_TOKEN(token: string) {
      this.token = token
    },

    ResetToken() {
        removeToken()
        this.SET_TOKEN('')
    }
  }, 
  persist:{
    enabled:true
  }
  
});

